﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

#nullable disable

namespace AutoUpdate.Models
{
    public partial class AutoUpdateDBContext : DbContext
    {
        public AutoUpdateDBContext()
        {
        }

        public AutoUpdateDBContext(DbContextOptions<AutoUpdateDBContext> options)
            : base(options)
        {
        }

        public virtual DbSet<TSysUpdate> TSysUpdates { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                optionsBuilder.UseSqlServer("Server=192.168.211.1;database=AutoUpdateDB;uid=sa;pwd=sa;Trusted_Connection=True;", builder => builder.UseRowNumberForPaging());
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<TSysUpdate>(entity =>
            {
                entity.ToTable("T_SysUpdate");

                entity.Property(e => e.Id).HasColumnName("ID");

                entity.Property(e => e.Exefile)
                    .HasColumnType("image")
                    .HasColumnName("exefile");

                entity.Property(e => e.FdownNum).HasColumnName("FDownNum");

                entity.Property(e => e.FfieldName)
                    .HasMaxLength(1000)
                    .IsUnicode(false)
                    .HasColumnName("FFieldName");

                entity.Property(e => e.FfileSize)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("FFileSize");

                entity.Property(e => e.FfileType).HasColumnName("FFileType");

                entity.Property(e => e.Fflag).HasColumnName("FFlag");

                entity.Property(e => e.Fid)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("FID");

                entity.Property(e => e.FinstallPath)
                    .HasMaxLength(2000)
                    .IsUnicode(false)
                    .HasColumnName("FInstallPath");

                entity.Property(e => e.FlastClientIp)
                    .HasMaxLength(15)
                    .IsUnicode(false)
                    .HasColumnName("FLastClientIP");

                entity.Property(e => e.FlastTime)
                    .HasColumnType("datetime")
                    .HasColumnName("FLastTime");

                entity.Property(e => e.Fmemo)
                    .HasMaxLength(200)
                    .IsUnicode(false)
                    .HasColumnName("FMemo");

                entity.Property(e => e.FmodifyTime)
                    .HasMaxLength(19)
                    .IsUnicode(false)
                    .HasColumnName("FModifyTime");

                entity.Property(e => e.FmustUpdate).HasColumnName("FMustUpdate");

                entity.Property(e => e.FnowUpdate)
                    .HasMaxLength(19)
                    .IsUnicode(false)
                    .HasColumnName("FNowUpdate");

                entity.Property(e => e.Forder).HasColumnName("FOrder");

                entity.Property(e => e.FproductId)
                    .HasMaxLength(50)
                    .IsUnicode(false)
                    .HasColumnName("FProductID");

                entity.Property(e => e.FpublishTime)
                    .HasColumnType("datetime")
                    .HasColumnName("FPublishTime");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
